function HandleContract1(gui, user, date, options, message) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._message = message;
  
  this._createElements();
};

HandleContract1.prototype._createElements = function() {
  //Preset
  //Object
  var client = (this._message[0] && this._message[0].data[0]) ? this._message[0].data[0] : null;
  var system = (this._message['sys'] && this._message['sys'].data[0]) ? this._message['sys'].data[0] : null;
  this._fee = { cost: 86.96,
                gst: 13.04,
                subtotal: 100.00,
                inz: 140,
                total: 240
              };
  
  //Display
  this._gui.company_address.value = 'Physical Address: ' + system.address;
  this._gui.company_phone.value = 'Office numbers: ' + system.phone + '   Fax: ' + system.fax;
  this._gui.company_email.value = 'Email: ' + system.email;
  
  this._gui.client_name.value = '[' + client.name_first + ' ' + client.name_family + ']';
  this._gui.client_address.value = 'Physical/Postal address: ' + MClientUtils.join([client.addr1, client.addr2, client.addr3]);
  this._gui.client_phone.value = 'Phone number: ' + MClientUtils.join([client.phone1, client.phone2, client.phone3]);
  this._gui.client_email.value = 'Email address: ' + client.email;
  
  this._gui.sign_client_name.value = '[' + client.name_first + ' ' + client.name_family + ']';
  //Event
  var _self = this;
  this._gui.fee_cost.onchange = function() { _self._fee.cost = MiscUtils.m2n(this.value);
                                             _self._fee.gst = _self._fee.cost * system.gst;
                                             _self._fee.subtotal = parseFloat(_self._fee.cost, 10) + parseFloat(_self._fee.gst, 10);
                                             _self._fee.total = parseFloat(_self._fee.subtotal, 10) + parseFloat(_self._fee.inz, 10);
                                             _self._update.call(_self);
                                           };
  this._gui.fee_subtotal.onchange = function() { _self._fee.subtotal = MiscUtils.m2n(this.value);
                                                 _self._fee.cost = _self._fee.subtotal / (parseFloat(system.gst, 10) + 1);
                                                 _self._fee.gst = _self._fee.subtotal - _self._fee.cost;
                                                 _self._fee.total = parseFloat(_self._fee.subtotal, 10) + parseFloat(_self._fee.inz, 10);
                                                 _self._update.call(_self);
                                               };
  this._gui.fee_inz.onchange = function() { _self._fee.inz = MiscUtils.m2n(this.value);
                                            _self._fee.total = parseFloat(_self._fee.subtotal, 10) + parseFloat(_self._fee.inz, 10);
                                            _self._update.call(_self);
                                          };
  this._gui.fee_total.onchange = function() { _self._fee.total = MiscUtils.m2n(this.value);
                                              _self._update.call(_self);
                                            };
  //Submit
};

HandleContract1.prototype._update = function() {
  this._gui.fee_cost.value = MiscUtils.n2m(this._fee.cost);
  this._gui.fee_gst.value = MiscUtils.n2m(this._fee.gst);
  this._gui.fee_subtotal.value = MiscUtils.n2m(this._fee.subtotal);
  this._gui.fee_inz.value = MiscUtils.n2m(this._fee.inz);
  this._gui.fee_total.value = MiscUtils.n2m(this._fee.total);
  
  this._gui.pay_inz.value = MiscUtils.n2m(this._fee.inz);
  this._gui.pay_total.value = MiscUtils.n2m(this._fee.total);
};

